package com.lzw.breezeNovel.webApp.mapper.video;

import com.lzw.breezeNovel.model.entity.pojo.video.ShortHistory;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

/**
 * @author 清风明月
 * @Package com.lzw.breezeNovel.webApp.mapper.video
 * @date 2025/3/24
 * @description 观看历史
 */
@Mapper
@SuppressWarnings("all")
public interface ShortHistoryMapper {

    /**
     * 查询观看历史
     * @param shortId
     * @param userId
     * @return
     */
    ShortHistory selectHistory(Long shortId, Long userId);

    /**
     * 添加观看历史
     * @param shortHistory
     */
    @Insert("insert into short_history(short_id,user_id) values(#{shortId},#{userId})")
    void insert(ShortHistory shortHistory);

    /**
     * 更新观看历史
     * @param shortHistory
     */
    @Update("update short_history set update_time = #{updateTime} where id = #{id}")
    void updateById(ShortHistory shortHistory);
}
